package view;

import memory.spel.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.TextView;

public class Help extends Activity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.help);
		
		TextView tekstView = (TextView) findViewById(R.id.helpView);
		tekstView.setMovementMethod(new ScrollingMovementMethod());
	}
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.menu, menu);
		menu.getItem(1).setTitle("spel");
		menu.getItem(2).setVisible(false);
		return true;
	}
	
	public boolean onOptionsItemSelected(MenuItem item) {
		Intent intent = null;
		
		switch(item.getItemId()) {
			case R.id.hoofdMenu:
				intent = new Intent(this, HoofdmenuView.class);
				startActivity(intent);
			break;
			case R.id.nieuwSpel:
				intent = new Intent(this, SpelbordView.class);
				startActivity(intent);
			break;
			case R.id.instellingen:
				intent = new Intent(this, Preferences.class);
				startActivity(intent);
			break;
			case R.id.help:
				intent = new Intent(this, Help.class);
				startActivity(intent);
			break;
		}
		return true;
	}
}
